﻿using System;

namespace MyHealthByDesign.Views
{
    /// <summary>
    /// Description:
    /// Displays health check page
    /// 
    /// Author: Sanjeev Shrestha
    /// Date Created: 10/21/2011
    /// 
    /// Other code files referenced:
    /// None.
    /// 
    /// Regression Test Information:
    /// None.
    /// 
    /// Revision History:
    /// 10/27/2011 Sanjeev Shrestha - Added logic for login check.
    /// 
    /// Known Faults:
    /// None.
    /// </summary>
    public partial class MyHealthCheck : System.Web.UI.Page
    {
        Domain.Domain domain = new Domain.Domain();

        /// <summary>
        /// Page Load event handler - check if user is logged in
        /// 
        /// PreConditions:
        /// None
        /// 
        /// PostConditions:
        /// Page displayed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!domain.IsUserLoggedIn())
            {
                Response.Redirect("../Default.aspx");
            }
        }

        /// <summary>
        /// Button click event handler - redirects to health Measurements page
        /// 
        /// PreConditions:
        /// None
        /// 
        /// PostConditions:
        /// Page displayed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnContinue_Click(object sender, EventArgs e)
        {
            Response.Redirect("MyHealthMeasurements.aspx");
        }
    }
}